<extend name="Public/layout"/>

<block name="style">
    <style type="text/css">
        body {
            background-color: #f6f6f6;
        }
    </style>
</block>

<block name="wrap">
    <div class="container">
        <div class="dashboard margin-top">
            <div class="row">
                <div class="col-xs-12 col-sm-6 col-md-4 ">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-actions"></div>
                            <i class="glyphicon glyphicon-home"></i> 关于CoreThink
                        </div>
                        <div class="panel-body">
                            <p>
                                CoreThink是一套轻量级WEB产品开发框架，追求简单、高效、卓越。可轻松实现移动互联网时代支持多终端的轻量级WEB产品快速开发。系统功能采用模块化开发，内置系统设置、分类管理、底部导航、数据备份、开发者工具（后台菜单管理、配置管理）、用户管理、部门管理、权限控制、内容模型、模板标签、模版主题、邮件管理、云存储、支付中心、插件扩展等模块，便于用户灵活扩展和二次开发。
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-actions"></div>
                            <i class="glyphicon glyphicon-cog"></i> 系统信息
                        </div>
                        <div class="panel-body">
                            <table class="table table-condensed">
                                <tbody>
                                        <tr>
                                            <td>CoreThink版本</td>
                                            <td>{:C('CORETHINK_VERSION')}</td>
                                        </tr>
                                        <tr>
                                            <td>ThinkPHP版本</td>
                                            <td>{$Think.VERSION}</td>
                                        </tr>
                                        <tr>
                                            <td>服务器操作系统</td>
                                            <td>{$Think.const.PHP_OS}</td>
                                        </tr>
                                        <tr>
                                            <td>运行环境</td>
                                            <td>{$_SERVER['SERVER_SOFTWARE']}</td>
                                        </tr>
                                        <tr>
                                            <td>MYSQL版本</td>
                                            <td><php>$system_info_mysql = M()->query("select version() as v;");</php>{$system_info_mysql.0.v}</td>
                                        </tr>
                                        <tr>
                                            <td>上传限制</td>
                                            <td>{:ini_get('upload_max_filesize')}</td>
                                        </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-actions"></div>
                            <i class="glyphicon glyphicon-th-list"></i> 产品团队
                        </div>
                        <div class="panel-body">
                            <table class="table table-condensed">
                                <tbody>
                                        <tr>
                                            <td>总策划</td>
                                            <td>江如意</td>
                                        </tr>
                                        <tr>
                                            <td>产品设计及研发团队</td>
                                            <td>江如意</td>
                                        </tr>
                                        <tr>
                                            <td>界面及用户体验团队</td>
                                            <td>江如意、赵瀚卿</td>
                                        </tr>
                                        <tr>
                                            <td>官方网址</td>
                                            <td><a href="http://www.corethink.cn">http://www.corethink.cn</a></td>
                                        </tr>
                                        <tr>
                                            <td>官方QQ群</td>
                                            <td>
                                                <a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=1ac8801c2f274de186f5c52203f428a1726ba9e3018aa579399b4c6161ca63cd">
                                                    <img border="0" src="" alt="CoreThink交流群01" title="CoreThink交流群01">
                                                </a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>联系我们</td>
                                            <td>598821125@qq.com</td>
                                        </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="pull-right">
                                <button id="daterange_set" class="btn btn-default btn-sm" style="margin-top:-5px;margin-right:-5px;"><span class="glyphicon glyphicon-cog"></span></button>
                            </div>
                            <i class="glyphicon glyphicon-stats"></i> 用户增长统计
                        </div>
                        <div class="panel-body">
                            <h5 class="text-center">{$start_date}－{$end_date} {$count_day}天用户增长</h5>
                            <canvas id="mychart" style="width:100%;height:300px;"></canvas>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function(){
            //用户增长曲线图
            var mychart = new Chart($("#mychart").get(0).getContext("2d")).Line(
                {
                    labels : {$user_reg_date},
                    datasets : [
                        {
                            fillColor : "#337ab7",
                            strokeColor : "#337ab7",
                            pointColor : "#337ab7",
                            pointStrokeColor : "#fff",
                            data : {$user_reg_count}
                        }
                    ]
                },
                {
                    scaleLineColor : "rgba(0,0,0,.1)", //X/Y轴的颜色
                    scaleLineWidth : 1 //X/Y轴的宽度
                }
            );

            //图表时间段选择
            $('#daterange_set').daterangepicker({
                    startDate: moment().subtract(29, 'days'),
                    endDate: moment(),
                    minDate: '01/01/2015',
                    maxDate: '12/31/2100',
                    dateLimit: {days: 360},
                    showDropdowns: true,
                    showWeekNumbers: true,
                    timePicker: false,
                    timePickerIncrement: 1,
                    timePicker12Hour: true,
                    ranges: {
                       '最近7天': [moment().subtract(6, 'days'), moment()],
                       '这个月': [moment().startOf('month'), moment().endOf('month')],
                       '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                    },
                    opens: 'left',
                    buttonClasses: ['btn btn-default'],
                    applyClass: 'btn-sm btn-primary',
                    cancelClass: 'btn-sm',
                    format: 'MM/DD/YYYY',
                    separator: ' to ',
                    locale: {
                        applyLabel: '确定',
                        cancelLabel: '取消',
                        fromLabel: '开始',
                        toLabel: '结束',
                        customRangeLabel: '自定义',
                        daysOfWeek: ['日', '一', '二', '三', '四', '五','六'],
                        monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                        firstDay: 1
                    }
                }, 
                function(start, end, label){
                    var url = '{:U("Index/index")}';
                    var query  = 'start_date='+start+'&end_date='+end;
                    if(url.indexOf('?')>0){
                        url += '&' + query;
                    }else{
                        url += '?' + query;
                    }
                    window.location.href = url;
                }
            );
        });
    </script>
</block>
